package me.xuym.crawler.t66y;

import me.xuym.crawler.simpleextension.dispatcher.SimpleDebugDispatcherInput;
import me.xuym.crawler.simpleextension.processor.filter.SimpleBlackFilterInput;
import me.xuym.crawler.simpleextension.processor.filter.SimpleCachedFilterInput;
import me.xuym.crawler.simpleextension.processor.filter.SimpleWhiteFilterInput;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

/**
 * Created by broche on 05/08/2017.
 */
public class T66yResult implements SimpleDebugDispatcherInput, SimpleBlackFilterInput, SimpleWhiteFilterInput, SimpleCachedFilterInput {
    private String url = "";
    private String content = "";
    private String torrent = "";

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTorrent() {
        return torrent;
    }

    public void setTorrent(String torrent) {
        this.torrent = torrent;
    }

    @Override
    public List<String> simpleBlackFilterFields() {
        List<String> fields = new ArrayList<>();
        fields.add(getUrl());
        fields.add(getContent());
        return fields;
    }

    @Override
    public List<String> simpleWhiteFilterFields() {
        List<String> fields = new ArrayList<>();
        fields.add(getContent());
        return fields;
    }

    @Override
    public Map<String, String> simpleCachedFilterCheckFields() {
        Map<String, String> fields = new Hashtable<>();
        fields.put("url", getUrl());
        return fields;
    }

    @Override
    public Map<String, String> simpleCachedFilterSaveFields() {
        return null;
    }

    @Override
    public String simpleDebugDispatcherContent() {
        return getUrl();
    }
}
